<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">
	
	<ui:define name="content">
		<h:inputHidden rendered="#{menuController.userRank != 2 and menuController.userRank != 1}" value="#{menuController.redirect()}"></h:inputHidden>
	   	<h:inputHidden value="#{menuController.setUrl(request.requestURL)}"></h:inputHidden>
	   	<h:inputHidden rendered="#{menuController.userRank == 2 or menuController.userRank == 1}">
	   <h:form>
	   		
		   		<h:panelGrid rendered="#{candidateHistoryController.hasScore}"  id="panou" columns="1">
					<h:outputText styleClass="tableTitle" value="Test details"></h:outputText>
					<h:panelGrid columns="2">
					<h:outputText styleClass="boldText" value="Name"></h:outputText>
					<h:outputText value="#{candidateHistoryController.viewDetailsInterview.template.title}"></h:outputText>
					<h:outputText styleClass="boldText" value="Duration"></h:outputText>
					<h:outputText value="#{candidateHistoryController.viewDetailsInterview.template.duration}"></h:outputText>
					<h:outputText styleClass="boldText" value="Date"></h:outputText>
					<h:outputText value="#{candidateHistoryController.viewDetailsInterview.dateString}"></h:outputText>
					<h:outputText styleClass="boldText" value="Room"></h:outputText>
					<h:outputText value="#{candidateHistoryController.viewDetailsInterview.room.address}"></h:outputText>
					<h:outputText styleClass="boldText" value="Score/categories"></h:outputText>
					<h:dataTable value="#{candidateHistoryController.scorePerCategories}" var="item">
						<h:column>
						<f:facet name="header">
	  						<h:outputText value="Category"/>
	  					</f:facet>
						<h:outputText value="#{item.key}"/>
					</h:column>
					<h:column>
						<f:facet name="header">
	  						<h:outputText value="Score"/>
	  					</f:facet> 		
						<h:outputText value="#{item.value}"/>
					</h:column>
					</h:dataTable>
					
					<h:outputText styleClass="boldText" value="Total score"></h:outputText>
					<h:outputText value="#{candidateHistoryController.totalScore}"></h:outputText>
					</h:panelGrid>
				</h:panelGrid>
			
	   </h:form>
	   <h:outputText styleClass="errorMessage" rendered="#{candidateHistoryController.noScore}" value="You have no results for this test!"></h:outputText>
	   <br></br>
	   <h:form>
				<h:commandButton styleClass="button" value="Back" actionListener="#{candidateHistoryController.goBack}"></h:commandButton>
			</h:form>
			</h:inputHidden>
	</ui:define>
	
</ui:composition>
</html>